var hoverZoomPlugins = hoverZoomPlugins || [];
hoverZoomPlugins.push( {
	name: 'TibiaNation',
	version: '0.1',
	prepareImgLinks: function(callback) {
		var res = [];
		$("#box_FeaturedPicture a img").each(function() {
			var link = $(this).parents('a:eq(0)');
			if(link) {
				var src = 'http://www.tibianation.net/' + $(this).attr('src').replace(/(.*?)_t1\.(.*?)/i, '$1.$2');
				$(link).data('hoverZoomSrc', [src]);
				if($(this).attr('title') && $(this).attr('title').length > 0)
					$(link).data('hoverZoomCaption', $(this).attr('title'));
				res.push(link);
			}
		});
		$("a img.photogallery_album_photo").each(function() {
			var link = $(this).parents('a:eq(0)');
			if(link) {
				var src = 'http://www.tibianation.net/' + $(this).attr('src').replace(/(.*?)_t1\.(.*?)/i, '$1.$2');
				$(link).data('hoverZoomSrc', [src]);
				if($(this).attr('title') && $(this).attr('title').length > 0)
					$(link).data('hoverZoomCaption', $(this).attr('title'));
				res.push(link);
			}
		});
		$("a img.photogallery_photo").each(function() {
			var link = $(this).parents('a:eq(0)');
			if(link) {
				var src = 'http://www.tibianation.net/' + $(this).attr('src').replace(/(.*?)_t2\.(.*?)/i, '$1.$2');
				$(link).data('hoverZoomSrc', [src]);
				var title = $(this).parents('a:eq(0)').parents('div:eq(0)').parents('td:eq(0)').find('td.tb12 a[href*=photo_gallery.php?photo_id=25]')
					$(link).data('hoverZoomCaption', title.html());
				res.push(link);
			}
		});
		callback($(res));
	}
});
